#include <algorithm>
#include <iostream>
using namespace std;
//部分反转字符串
class Solution
{
public:
    static string reverseStr(string s, int k)
    {
        int n = s.size();
        int i = 0;
        for(i=0; i<n; i+=2*k)
        {
            int end = min(i+k, n);
            std::reverse(s.begin()+i, s.begin()+end);
        }
        return s;
    }
};